package com.sys.basics.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sys.basics.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sys.basics.entity.vo.UserOrgRoleVo;

import java.util.List;


/**
 * @author: ares
 * @date: 2021-09-28
 * @description: 用户表 服务类
 */
public interface SysUserService extends IService<SysUser> {
    SysUser getByUsername(String username);

    SysUser getByShortcode(String shortcode);

    SysUser getByAccount(String account);

    SysUser getCurrentUserInfoWithRoleAndOrg(Long userId);

    boolean modifySelfPwd(SysUser user, String oldPwd, String newPwd);

    boolean resetSomeonePwd(Long userId);

    boolean updateUserDefaultOrg(Long userId, Long orgId);

    IPage<SysUser> getPagesByOrg(Page<SysUser> page, Long orgId, SysUser userParams);

    int batchUpdateStatus(List<Long> userIds, Integer status);

    int createUserLinkOrgRole(UserOrgRoleVo user);

    int updateUserLinkOrgRole(UserOrgRoleVo user, Long defaultOrgId);
}
